{include file="common/header"}
<div id="app" v-cloak>
	<el-curd
		:field="field"
		:search-date="false">
	</el-curd>
</div>
<script>
	new Vue({
		el: "#app",
		data() {
			return {
				field: [
					{
						prop: 'id',
						label: '主键',
						table: {
							sort: true,
						},
						form: {
							is: 'el-input',
						}
					},
					{
						prop: 'name',
						label: '优惠券名称',
						table: {
							sort: true,
						},
						form: {
							is: 'el-input',
						}
					},
					{
						prop: 'merchant_id',
						label: '商户名称',
						table: {
							sort: true,
						},
						form: {
							is: 'el-select',
							placeholder: '',
							default: [],
							child: {
								value: [],
								props: {label: 'title', value: 'value'}
							},
							filterable: true,
							multiple: true,
						}
					},
					{
						prop: 'start_time',
						label: '开始时间',
						table: {
							sort: true,
						},
						form: {
							is: 'el-date-picker',
							type: 'date',
							format: 'yyyy-MM-dd',
							valueFormat: 'yyyy-MM-dd',
						}
					},
					{
						prop: 'end_time',
						label: '结束时间',
						table: {
							sort: true,
						},
						form: {
							is: 'el-date-picker',
							type: 'date',
							format: 'yyyy-MM-dd',
							valueFormat: 'yyyy-MM-dd',
						}
					},
					{
						prop: 'amount',
						label: '金额',
						table: {
							sort: true,
						},
						form: {
							is: 'el-input',
						}
					},
					{
						prop: 'number',
						label: '发布数量',
						table: {
							sort: true,
						},
						form: {
							is: 'el-input',
						}
					},
					{
						prop: 'status',
						label: '状态',
						table: {
							sort: true,
						},
						form: {
							is: 'el-switch',
							default: 0,
						}
					},
				],
			}
		},
	})
</script>
{include file="common/footer"}